<?php 
         $URL = $CI->uri->uri_to_assoc();
         $option_type = trim( mysql_escape_string($URL["type"]) );
         $report_code = array();
         
         switch ($option_type){
             case "1":
                 $report_code = $CI->collegian_model->get_collegian_signin_activity($act_id , 1);
                 $url = "export_report_print_code";
                 break;
             case "2":
                 $report_code = $CI->collegian_model->get_collegian_signin_activity($act_id , 2);
                 $url = "printhtml";
                 break;
             case "3":
                 $report_code = $CI->collegian_model->get_collegian_signin_activity($act_id , 3);
                 $url = "printhtml";
                 break;
         }
        
?>
<div class="main-content shadow">
        <div class="dv-980">
                <button  onclick="window.location = '<?=base_url()?>activity/<?=$url?>/ID/<?=$act_id?>/type/<?=$option_type?>' "    class="button-x orange"  type="button"  style="line-height:2em"    >
                <img style="float:left"  src="<?=base_url()?>res/images/history.png"  />
                            &nbsp;&nbsp;พิมพ์
                </button>
            
        </div>
        <div style="height:30px"></div>
        <?php if($option_type == 1 || $option_type == 2){ ?>
        <table style="margin: 0 auto"  align="center"  class="formtable" width="94%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <th colspan="8" align="center" valign="middle">
                &nbsp;<b><?php if($option_type == 1){ ?>แสดงข้อมูลนักศึกษาลงทะเบียนเข้าร่วมกิจกรรม <?php }else{ ?>แสดงข้อมูลนักศึกษาเข้าร่วมกิจกรรม <?php } ?>:  <?=$report_code->row(0)->act_title?> </b>
            </th>
          </tr>
          <tr>
            <th width="9%" align="center" valign="middle">รหัส</th>
            <th width="15%" align="center" valign="middle">ชื่อ-สกุล</th>
            <th width="12%" align="center" valign="middle">โปรแกรมวิชา</th>
            <th width="3%" align="center" valign="middle">ชั้นปี</th>
            <?php if($URL["type"] != "2"){ ?>
            <th width="13%" align="center" valign="middle">รหัสลงทะเบียน</th>
            <?php } ?>
          </tr>
          <?php foreach($report_code->result_array() as $row){  ?>
          <tr>
            <td align="center" valign="middle">&nbsp;<b><?=$row["collegian_code"]?></b></td>
            <td align="left" valign="middle">&nbsp;<?=$row["collegian_name"]?></td>
            <td align="center" valign="middle">&nbsp;<?=$row["major_title"]?></td>
            <td align="center" valign="middle">&nbsp;<?=  get_level($row["collegian_code"])?></td>
            <?php if($URL["type"] != "2"){ ?>
            <td align="center" valign="middle">
                <b> <?=$row["codestring"]?></b>
            </td>
          <?php } ?>
          </tr>
          <?php } ?>
        </table>
        <?php } ?>
        <?php if($option_type == 3){ ?>
        <table style="margin: 0 auto"  align="center"  class="formtable" width="94%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <th colspan="8" align="center" valign="middle">
                &nbsp;<b>แสดงข้อมูลนักศึกษาไม่เข้าร่วมกิจกรรม :  <?=$report_code->row(0)->act_title?> </b>
            </th>
          </tr>
          <tr>
            <th width="9%" align="center" valign="middle">รหัส</th>
            <th width="15%" align="center" valign="middle">ชื่อ-สกุล</th>
            <th width="12%" align="center" valign="middle">โปรแกรมวิชา</th>
            <th width="3%" align="center" valign="middle">ชั้นปี</th>
          </tr>
          <?php foreach($report_code->result_array() as $row){  ?>
          <tr>
            <td align="center" valign="middle">&nbsp;<b><?=$row["collegian_code"]?></b></td>
            <td align="left" valign="middle">&nbsp;<?=$row["collegian_name"]?></td>
            <td align="center" valign="middle">&nbsp;<?=$row["major_title"]?></td>
            <td align="center" valign="middle">&nbsp;<?=  get_level($row["collegian_code"])?></td>
          </tr>
          <?php } ?>
        </table>
        <?php } ?>
        <div style="height:30px"></div>
</div>
